<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>附件管理</title>
    <link rel="stylesheet" href="plugins/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="css/global.css" media="all">
    <link rel="stylesheet" href="plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="css/table.css" />
    <link rel="stylesheet" href="css/style.css" />
</head>

<body>
<div class="admin-main">
    <div class="handle-box">
        <form class="layui-form">
        <ul>

                 <li class="handle-item layui-clear">

                      <div class="layui-form-item">
                          <div class="layui-inline">
                              <label class="layui-form-label" style="width: auto;">时间</label>
                              <div class="layui-input-inline" style="width: 100px;">
                                  <input type="text" name="" placeholder="开始时间" autocomplete="off" class="layui-input"  id="LAY_demorange_s">
                              </div>
                              <div class="layui-form-mid">-</div>
                              <div class="layui-input-inline" style="width: 100px;">
                                  <input type="text" name="" placeholder="结束时间" autocomplete="off" class="layui-input" id="LAY_demorange_e">
                              </div>
                          </div>

                          <div class="layui-inline">
                                  <div class="layui-input-inline" style="width: 100px;">
                                      <select name="interest" lay-filter="">
                                          <option value=""></option>
                                          <option value="0">陕西省</option>
                                          <option value="1" selected="">安徽省</option>
                                      </select>
                                  </div>
                                  <div class="layui-input-inline"  style="width: 100px;">
                                      <select name="interest" lay-filter="">
                                          <option value="" ></option>
                                          <option value="0" selected="">全部</option>
                                          <option value="0">西安市</option>
                                          <option value="1" >安康市</option>
                                          <option value="2">商洛市</option>
                                          <option value="3">咸阳市</option>
                                          <option value="4">宝鸡市</option>
                                      </select>
                                  </div>
                                  <div class="layui-input-inline"  style="width: 130px;">
                                      <select name="interest" lay-filter="">
                                          <option value=""></option>
                                          <option value="" selected="">全部</option>
                                          <option value="0">雁塔分局</option>
                                          <option value="1">碑林分局</option>
                                          <option value="2">莲湖分局</option>
                                          <option value="3">咸阳市</option>
                                          <option value="4">宝鸡市</option>
                                      </select>
                                  </div>
                                  <div class="layui-input-inline"  style="width: 130px;">
                                      <select name="interest" lay-filter="">
                                          <option value=""></option>
                                          <option value="" selected="">全部</option>
                                          <option value="0">曲江派出所</option>
                                          <option value="1">锦业路派出所</option>
                                          <option value="2">雁翔路派出所</option>
                                          <option value="3">唐延路派出所</option>
                                          <option value="4">文一路派出所</option>
                                      </select>
                                  </div>
                              </div>


                          <button class="layui-btn mgl-20" >查询</button>

                      </div>
                    <span class="fr" style="float: right;">
                        <a class="layui-btn layui-btn-danger radius btn-delect" id="btn-delect-all"><i class="layui-icon">&#xe640;</i> 批量删除</a>
                        <a  href="newfile.html" class="layui-btn btn-add btn-default" ><i class="layui-icon">&#xe62f;</i> 上传附件</a>
                    </span>
             </li>

        </ul>
        </form>
    </div>


    <table class="site-table table-hover">
        <thead>
        <tr>
            <th  style="width: 30px;"><input type="checkbox" id="selected-all"></th>
            <th>所属派出所</th>
            <th>省/直辖市</th>
            <th>市/县</th>
            <th>分局</th>
            <th>备注</th>
            <th>上传人</th>
            <th>所属客户</th>
            <th>上传时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <tr>
            <td><input type="checkbox"></td>
            <td>曲江派出所</td>
            <td>陕西省</td>
            <td>西安市</td>
            <td>雁塔分局</td>
            <td>已付款并领取奖品</td>
            <td>王晓明[23564578]</td>
            <td>黄英[612430156895477857]</td>
            <td>2016-12-26</td>
            <td>
                <a href="file-detail.html" class="layui-btn layui-btn-mini">查看附件</a>
                <a href="file-contact.html" class="layui-btn layui-btn-warm layui-btn-mini">关联客户</a>
                <a href="javascript:;" data-id="1" data-opt="del" class="layui-btn layui-btn-danger layui-btn-mini">删除</a>
            </td>
        </tr>
        <tr>
            <td><input type="checkbox"></td>
            <td>曲江派出所</td>
            <td>陕西省</td>
            <td>西安市</td>
            <td>雁塔分局</td>
            <td>已付款并领取奖品</td>
            <td>王晓明[23564578]</td>
            <td>黄英[612430156895477857]</td>
            <td>2016-12-26</td>
            <td>
                <a href="file-detail.html" class="layui-btn layui-btn-mini">查看附件</a>
                <a href="file-contact.html" class="layui-btn layui-btn-warm layui-btn-mini">关联客户</a>
                <a href="javascript:;" data-id="1" data-opt="del" class="layui-btn layui-btn-danger layui-btn-mini">删除</a>
            </td>
        </tr>

        </tbody>
    </table>

    <div class="admin-table-page">
        <div id="page" class="page">
        </div>
    </div>

</div>
<!-- <script type="text/javascript" src="js/layer.js"></script>-->
<script type="text/javascript" src="plugins/layui/layui.js"></script>
<script>
    layui.config({
        base: 'plugins/layui/modules/'
    });
    layui.use(['icheck', 'laypage','layer','form', 'laydate'], function() {
        var $ = layui.jquery,
                laypage = layui.laypage,
                layer = layui.layer;
        $('input').iCheck({
            checkboxClass: 'icheckbox_flat-green'
        });

        //分页操作
        laypage({
            cont: 'page',
            pages: 25, //总页数
            groups: 5, //连续显示分页数
            jump: function(obj, first) {
                //得到了当前页，用于向服务端请求对应数据
                var curr = obj.curr;
                if(!first) {
                    //layer.msg('第 '+ obj.curr +' 页');
                }
            }
        });


        //列表选择
        $('.site-table tbody tr').on('click', function(event) {
            var $this = $(this);
            var $input = $this.children('td').eq(0).find('input');
            $input.on('ifChecked', function(e) {
                $this.css('background-color', '#EEEEEE');
            });
            $input.on('ifUnchecked', function(e) {
                $this.removeAttr('style');
            });
            $input.iCheck('toggle');
        }).find('input').each(function() {
            var $this = $(this);
            $this.on('ifChecked', function(e) {
                $this.parents('tr').css('background-color', '#EEEEEE');
            });
            $this.on('ifUnchecked', function(e) {
                $this.parents('tr').removeAttr('style');
            });
        });
        //全选
        $('#selected-all').on('ifChanged', function(event) {
            var $input = $('.site-table tbody tr td').find('input');
            $input.iCheck(event.currentTarget.checked ? 'check' : 'uncheck');
        });


        //日期选择
        var laydate = layui.laydate;

        var start = {
            min: laydate.now()
            ,max: '2099-06-16 23:59:59'
            ,istoday: false
            ,choose: function(datas){
                end.min = datas; //开始日选好后，重置结束日的最小日期
                end.start = datas //将结束日的初始值设定为开始日
            }
        };

        var end = {
            min: laydate.now()
            ,max: '2099-06-16 23:59:59'
            ,istoday: false
            ,choose: function(datas){
                start.max = datas; //结束日选好后，重置开始日的最大日期
            }
        };

        document.getElementById('LAY_demorange_s').onclick = function(){
            start.elem = this;
            laydate(start);
        };
        document.getElementById('LAY_demorange_e').onclick = function(){
            end.elem = this
            laydate(end);
        };

        //搜索区域
        var form = layui.form(),
                layer = layui.layer,
                layedit = layui.layedit,
                laydate = layui.laydate;
        //自定义验证规则
        form.verify({
            /* police: function(value) {
             if(value.length < 4) {
             return '标题至少得4个字符啊';
             }
             },
             pass: [/(.+){6,12}$/, '密码必须6到12位'],
             content: function(value) {
             layedit.sync(editIndex);
             }*/
        });

        //监听提交
        form.on('submit(branch)', function(data) {
            layer.alert(JSON.stringify(data.field), {
                title: '最终的提交信息'
            })
            return false;
        });

    });


</script>

</body>

</html>